function answer = is_error_undefined_function (err)
    if (nargin < 1),  err = lasterror ();  end %#ok<LERR>
    answer = any(strcmp(err.identifier, {...
        'MATLAB:UndefinedFunction', ...
        'MATLAB:scriptNotAFunction', ...
        'Octave:undefined-function'}));
    if answer,  return;  end
    answer = is_octave() && isempty(err.identifier) && (...
           ~isempty(strfind(err.message, 'undefined')) ...
        || ~isempty(strfind(err.message, 'library open failed')) ...
        || ~isempty(strfind(err.message, 'could not find')) );
end
